{template header}

<style>
	.m-success, .m-warn, .m-error {
		background: url("{ADMIN_WEBURLPATH}/images/ico-pa.png") no-repeat scroll 0 0 transparent;
		padding-left: 20px;
		
	}
	.m-success {
		background-position: -164px -390px;
	}
	.m-warn {
		background-position: -59px -480px;
	}
	.m-error {
		background-position: -124px -420px;
	}
</style>

<!--{if $webglobal[mode]=='user'}-->

	<form name="searchform" method="post" action="{ADMIN_WEBURLPATH}/index.php?mode=user">
	<table class="datatable" cellspacing="1">
		<thead>
			<tr>
				<td colspan="3">搜索用户</td>
			</tr>
		</thead>
		<tbody>
			<tr>
				<th style="width: 100px;">搜索选项</th>
				<td>
					<select name="status">
						<option value="-2">--- 用户状态 ---</option>
						<!--{loop $webglobal[file_user][status] $statuskey $statusvalue}-->
						<option value="{$statuskey}">{$statusvalue}</option>
						<!--{/loop}-->
					</select>
					<select name="gender">
						<option value="-1">--- 用户性别 ---</option>
						<option value="0">保密</option>
						<option value="1">男</option>
						<option value="2">女</option>
					</select>
					<select name="auth_tel">
						<option value="-1">--- 手机认证 ---</option>
						<option value="0">未通过</option>
						<option value="1">已通过</option>
					</select>
					<select name="auth_indentity">
						<option value="-1">--- 身份证认证 ---</option>
						<option value="0">未通过</option>
						<option value="1">已通过</option>
					</select>
					<script type="text/javascript">common_CheckedSelect('status', '{$webrequest[status]}');</script>
					<script type="text/javascript">common_CheckedSelect('gender', '{$webrequest[gender]}');</script>
					<script type="text/javascript">common_CheckedSelect('auth_tel', '{$webrequest[auth_tel]}');</script>
					<script type="text/javascript">common_CheckedSelect('auth_indentity', '{$webrequest[auth_indentity]}');</script>
					关键字:<input type="text" name="searchkey" value="$webrequest[searchkey]" size="50" />
				</td>
				<td style="width: 100px; text-align: center"><input type="submit" name="searchsubmit" value=" 搜  索 " /></td>
			</tr>
		</tbody>
	</table>
	</form>

	<form id="userform" name="editform" method="post" action="{ADMIN_WEBURLPATH}/index.php?mode=userup&check&gourl={$webglobal[file_user][gourlencode]}">
	<table class="datatable" cellspacing="1">
		<thead>
			<tr>
				<th width="5%"></th>
				<th width="5%">编号</th>
				<th>用户名</th>
				<th>邮箱</th>
				<th>昵称</th>
				<th>手机号</th>
				<th>积分</th>
				<th>手机认证</th>
				<th>身份证认证</th>
				<th>状态</th>
				<th>注册IP</th>
				<th>注册时间</th>
				<th>管理</th>
			</tr>
		</thead>
		<tbody>
			<!--{if $webglobal[file_user][datanum]>0}-->
				<!--{loop $webglobal[file_user][dataarray] $tempkey $temptable}-->
					<tr>
						<td{$temptable[tdclass]}><input class="selectUnit" type="checkbox" name="delid[]" value="{$tempkey}" /></td>
						<td{$temptable[tdclass]}>$temptable[id]</td>
						<td{$temptable[tdclass]}>{$temptable[username]}</td>
						<td{$temptable[tdclass]}>{$temptable[email]}</td>
						<td{$temptable[tdclass]}>{$temptable[nickname]}</td>
						<td{$temptable[tdclass]}>{$temptable[tel]}</td>
						<td{$temptable[tdclass]}>{$temptable[score]}</td>
						<td{$temptable[tdclass]}><strong class="{$temptable[auth_tel][0]}">{$temptable[auth_tel][1]}</strong></td>
						<td{$temptable[tdclass]}><strong class="{$temptable[auth_indentity][0]}">{$temptable[auth_indentity][1]}</strong></td>
						<td{$temptable[tdclass]}><strong class="{$temptable[status][0]}">{$temptable[status][1]}</strong></td>
						<td{$temptable[tdclass]}>{$temptable[regip]}</td>
						<td{$temptable[tdclass]}>{$temptable[regtime_show]}</td>
						<td{$temptable[tdclass]}>
							<a href="{ADMIN_WEBURLPATH}/index.php?mode=useredit&editid={$tempkey}&gourl={$webglobal[file_user][gourlencode]}" class="special">[编辑]</a>
						</td>
					</tr>
				<!--{/loop}-->
			<!--{else}-->
				<tr><td colspan="13" style="text-align: center">还没有用户。</td></tr>
			<!--{/if}-->
		</tbody>
	</table>

	<!--{if $webglobal[file_user][datanum]>0}-->
		<table style="width:100%;border-style:none;" cellpadding="0" cellspacing="0">
			<tr>
				<td>
				<input onclick="selectallbutton()" type="button" value="全选" />
				<input id ="del" onclick ="comfirmdel()" type="button" name="adminsubmit" value="批量删除" />
				<input id ="selecthidden" type="hidden" value="0" />
				</td>
				<td style="text-align:right;margin:0;padding:5px 0;">{template page}</td>
			</tr>
		</table>
	<!--{/if}-->
	</form>
	<script type="text/javascript">
<!--
		function comfirmdel(){
			if(confirm('是否批量删除')){
				$('#userform').submit();
			}
		}
		function selectallbutton() {
			if($('#selecthidden').val()==0){
				$('#selecthidden').val('1');
			}else{
				$('#selecthidden').val('0');
			}
			$('.selectUnit').each(function(){
				if($('#selecthidden').val()=='1'){
					$(this).attr('checked',true);
				}else{
					$(this).attr('checked',false);
				}
			});
		}
//-->
</script>
<!--{elseif $webglobal[mode]=='useredit'}-->
	<script type="text/javascript" charset="utf-8" src="{ADMIN_WEBURLPATH}/images/calendar.js"></script>
	<script type="text/javascript" charset="utf-8" src="{WEBURLPATH}/editor/kindeditor-min.js"></script>
	<script type="text/javascript" src="{WEBURLPATH}/javascript/yetii.js"></script>
	<script type="text/javascript" src="{WEBURLPATH}/javascript/jquery.linkagesel-min.js"></script>
	<script type="text/javascript" src="{WEBURLPATH}/javascript/district-all.js"></script>
	<table class="menutable" cellspacing="1">
		<thead>
			<tr><td>用户管理</td></tr>
		</thead>
		<tbody>
			<tr><td>
				<a href="{ADMIN_WEBURLPATH}/index.php?mode=user&{$webrequest[gourl]}">[用户列表]</a>
			</td></tr>
		</tbody>
	</table>

	<div class="demolayout" id="demo">
		<ul class="demolayout" id="demo-nav">
			<li class="activeli"><a href="#tab1" class="active">基本信息</a></li>
			<li class=""><a href="#tab2" class="">个人设置</a></li>
			<li class=""><a href="#tab3" class="">兴趣爱好</a></li>
			<li class=""><a href="#tab4" class="">其他信息</a></li>
		</ul>
		<form name="editform" method="post" action="{ADMIN_WEBURLPATH}/index.php?mode=useredit&check&gourl={$webglobal[file_user][gourlencode]}">
		<input type="hidden" name="editid" value="{$webrequest[editid]}" />
		<div class="tabs-container">
			<div id="tab1" class="tab" style="display: block;">
				<table class="datatable" cellspacing="1">
					<tbody>
						<tr>
							<th>登录名</th>
							<td>
								{$webglobal[file_user][editinfo][username]}
							</td>
						</tr>
						<tr>
							<th>邮箱</th>
							<td>
								{$webglobal[file_user][editinfo][email]}
							</td>
						</tr>
						<tr>
							<th>电话</th>
							<td>
								<input type="text" name="tel" style="width:200px;" value="{$webglobal[file_user][editinfo][tel]}" />
							</td>
						</tr>
						<tr>
							<th>身份证</th>
							<td>
								<input type="text" name="indentitycard" style="width:200px;" value="{$webglobal[file_user][editinfo][indentitycard]}" />
							</td>
						</tr>
						<tr>
							<th>手机认证</th>
							<td>
								<strong class="{$webglobal[file_user][editinfo][auth_tel][0]}">{$webglobal[file_user][editinfo][auth_tel][1]}</strong>
							</td>
						</tr>
						<tr>
							<th>身份证认证</th>
							<td>
								<strong class="{$webglobal[file_user][editinfo][auth_indentity][0]}">{$webglobal[file_user][editinfo][auth_indentity][1]}</strong>
							</td>
						</tr>
						<tr>
							<th>用户状态</th>
							<td>
								<select name="status">
									<!--{loop $webglobal[file_user][status] $statuskey $statusvalue}-->
									<option value="{$statuskey}">{$statusvalue}</option>
									<!--{/loop}-->
								</select>
							</td>
						</tr>
						<tr>
							<th>积分</th>
							<td>
								<input type="text" name="score" style="width:100px;" value="{$webglobal[file_user][editinfo][score]}" />
							</td>
						</tr>
					</tbody>
				</table>
			</div>

			<div id="tab2" class="tab" style="display: none;">
				<table class="datatable" cellspacing="1">
					<tbody>
						<tr>
							<th>昵称</th>
							<td>
								<input type="text" name="nickname" style="width:200px;" value="{$webglobal[file_user][editinfo][nickname]}" />
							</td>
						</tr>
						<tr>
							<th>真实姓名</th>
							<td>
								<input type="text" name="truename" style="width:200px;" value="{$webglobal[file_user][editinfo][truename]}" />
							</td>
						</tr>
						<tr>
							<th>头像</th>
							<td>
								{$webglobal[file_user][editinfo][avatar]}
							</td>
						</tr>
						<tr>
							<th>性别</th>
							<td>
								<select name="gender">
									<option value="0">保密</option>
									<option value="1">男</option>
									<option value="2">女</option>
								</select>
							</td>
						</tr>
						<tr>
							<th>出生日期</th>
							<td>
								<input type="text" name="birthday" style="width:200px;" value="{$webglobal[file_user][editinfo][birthday]}" onfocus="c.showMoreDay=false;c.show(this);" />
							</td>
						</tr>
						<tr>
							<th>出生地</th>
							<td>
								<select id="birthday_province" name="birthday_address[]"></select>
								<select id="birthday_city" name="birthday_address[]"></select>
								<select id="birthday_district" name="birthday_address[]"></select>
								<input type="hidden" id="birthday_address_name" name="birthday_address_name" value="{$webglobal['file_user']['editinfo']['birth_address']['area_text']}" />
							</td>
						</tr>
						<tr>
							<th>个人描述</th>
							<td>
								{$webglobal[file_user][editinfo][description]}
							</td>
						</tr>
						<tr>
							<th>个性签名</th>
							<td>
								<script>
									KE.show({
										id : 'signhtml',
										items : ['bold', 'link'],
										resizeMode : 0
									});
								</script>
								<textarea id="signhtml" name="signhtml" style="width:270px;height:150px;">{$webglobal[file_user][editinfo][signhtml]}</textarea>
							</td>
						</tr>
					</tbody>
				</table>
			</div>	
			<div id="tab3" class="tab" style="display: none;">
				<table class="datatable" cellspacing="1">
					<tbody>
						<tr>
							<th>兴趣</th>
							<td>
								{$webglobal[file_user][editinfo][interests]}
							</td>
						</tr>
					</tbody>
				</table>
			</div>
			<div id="tab4" class="tab" style="display: none;">
				<table class="datatable" cellspacing="1">
					<tbody>
						<tr>
							<th>注册IP</th>
							<td>
								{$webglobal[file_user][editinfo][regip]}
							</td>
						</tr>
						<tr>
							<th>注册时间</th>
							<td>
								{$webglobal[file_user][editinfo][regtime_show]}
							</td>
						</tr>
						<tr>
							<th>最后登录IP</th>
							<td>
								{$webglobal[file_user][editinfo][loginip]}
							</td>
						</tr>
						<tr>
							<th>最后登录时间</th>
							<td>
								{$webglobal[file_user][editinfo][logintime_show]}
							</td>
						</tr>
					</tbody>
				</table>
			</div>
			<table class="datatable" cellspacing="1">
				<tfoot>
					<tr><td colspan="2">
						<input type="submit" name="adminsubmit" class="submitok" value=" 确  认 " />&nbsp;&nbsp;
						<input type="reset" name="adminreset" value=" 取  消 " />
					</td></tr>
				</tfoot>
			</table>
		</div>
		</form>
	</div>
	<script type="text/javascript">
		var tabber1 = new Yetii({
			id: 'demo',
			persist: true
		});
	</script>
	<script type="text/javascript">common_CheckedSelect('gender', '{$webglobal[file_user][editinfo][gender]}');</script>
	<script type="text/javascript">common_CheckedSelect('status', '{$webglobal[file_user][editinfo][status]}');</script>
	<script type="text/javascript">
		$(document).ready(function(){
			var opts = {
					data: districtData,
					selStyle: 'margin-left: 3px;',
					select: ['#birthday_province', '#birthday_city', '#birthday_district'],
					defVal: [{$webglobal['file_user']['editinfo']['birth_address']['id_list']}]
			};
			var linkageSel = new LinkageSel(opts);
			districtData = opts = null; // 如果数据量大最好在创建LinkageSel实例之后清空

			linkageSel.onChange(function() {
				var input = $('#birthday_address_name'),
					d = this.getSelectedDataArr('name'),    // 所有有选定菜单的name. this === linkageSel2
					arr = [];
				for (var i = 0, len = d.length; i < len; i++) {
					arr.push(d[i]);
				}
				input.val(arr.join(','));
			});
		});
	</script>
<!--{elseif $webglobal[mode]=='usergroupadd'}-->
	<table class="menutable" cellspacing="1">
		<thead>
			<tr><td>用户组管理</td></tr>
		</thead>
		<tbody>
			<tr><td>
				<a href="{ADMIN_WEBURLPATH}/index.php?mode=usergroup">[用户组列表]</a>
			</td></tr>
		</tbody>
	</table>

	<form name="addform" method="post" action="{ADMIN_WEBURLPATH}/index.php?mode=usergroupadd&check">
	<table class="datatable" cellspacing="1">
		<thead>
			<tr><td colspan="2">添加用户组信息</td></tr>
		</thead>
		<tbody>
			<tr>
				<th>用户组名称<span class="need"> *</span></th>
				<td>
					<input type="text" name="name" size="40" value="" />
				</td>
			</tr>
			<tr>
				<th>设定权限<input type="checkbox" onclick="adminuser_CheckAll(this);" /></th>
				<td>
					{template purviewlist}
				</td>
			</tr>
		</tbody>
		<tfoot>
			<tr><td colspan="2">
				<input type="submit" name="adminsubmit" class="submitok" value=" 确  认 " />&nbsp;&nbsp;
				<input type="reset" name="adminreset" value=" 取  消 " />
			</td></tr>
		</tfoot>
	</table>
	</form>
<!--{elseif $webglobal[mode]=='usergroupedit'}-->
	<table class="menutable" cellspacing="1">
		<thead>
			<tr><td>用户组管理</td></tr>
		</thead>
		<tbody>
			<tr><td>
				<a href="{ADMIN_WEBURLPATH}/index.php?mode=usergroup">[用户组列表]</a>
			</td></tr>
		</tbody>
	</table>

	<form name="addform" method="post" action="{ADMIN_WEBURLPATH}/index.php?mode=usergroupedit&check">
	<input type="hidden" name="editid" value="{$webrequest[editid]}" />
	<table class="datatable" cellspacing="1">
		<thead>
			<tr><td colspan="2">修改用户组信息</td></tr>
		</thead>
		<tbody>
			<tr>
				<th>用户组名称<span class="need"> *</span></th>
				<td>
					<input type="text" name="name" size="40" value="{$webglobal[file_usergroup][editinfo][name]}" />
				</td>
			</tr>
			<tr>
				<th>设定权限<input type="checkbox" onclick="adminuser_CheckAll(this);" /></th>
				<td>
					{template purviewlist}
				</td>
			</tr>
		</tbody>
		<tfoot>
			<tr><td colspan="2">
				<input type="submit" name="adminsubmit" class="submitok" value=" 确  认 " />&nbsp;&nbsp;
				<input type="reset" name="adminreset" value=" 取  消 " />
			</td></tr>
		</tfoot>
	</table>
	</form>
<!--{/if}-->

{template footer}